# coding: utf-8
from typing import Any, Union, Tuple, List

from pydantic import BaseModel, Field


class FuncStepModel(BaseModel):
    """
    函数步骤模型
    function step model class
    """
    name: str = Field('', description="步骤名称", alias='步骤名称')
    description: str = Field('', description="步骤描述", alias='步骤描述')
    func: str = Field(..., description="`PlayWrightUtil` 类中需要执行的函数", alias='函数名')
    args: Union[List, Tuple] = Field([], description="函数参数列表", alias='参数列表')
    kwargs: dict = Field({}, description="函数关键字参数字典", alias='参数字典')
    callback: Union[None, "FuncStepModel"] = Field(None, description="回调函数", alias='回调函数')


class AssertDataModel(BaseModel):
    actual: Union[Any, FuncStepModel] = Field(alias='实际值')
    expected: Any = Field(None, alias='期望值')
    method: str = Field(alias='断言方法')
    message: str = Field(None, alias='断言消息')
